package com.inspur.edp.bff.engine.core.exception;

import io.iec.edp.caf.commons.exception.CAFRuntimeException;
import io.iec.edp.caf.commons.exception.ExceptionLevel;

public class BffEngineCoreException extends CAFRuntimeException{
    public static final String SU = "pfcommon";
    public static final String RESOURCE_FILE = "bff_engine_exception.properties";

    public BffEngineCoreException(Throwable innerException) {
        super(SU, "", "", (Exception) innerException);
    }

    public BffEngineCoreException(BffEngineCoreErrorCodes errCodes) {
        super(SU, RESOURCE_FILE, errCodes.name(), null, null, ExceptionLevel.Error, true);
    }

    public BffEngineCoreException(BffEngineCoreErrorCodes errCodes, String... messageParams) {
        super(SU, RESOURCE_FILE, errCodes.name(), messageParams, null, ExceptionLevel.Error, false);
    }
    public BffEngineCoreException(BffEngineCoreErrorCodes errCodes, boolean bizException, String... messageParams) {
        super(SU, RESOURCE_FILE, errCodes.name(), messageParams, null, ExceptionLevel.Error, bizException);
    }
    public BffEngineCoreException(Throwable innerException, BffEngineCoreErrorCodes errCodes, String... messageParams) {
        super(SU, RESOURCE_FILE, errCodes.name(), messageParams, (Exception) innerException, ExceptionLevel.Error, false);
    }

    public BffEngineCoreException(String SUCode, BffEngineCoreErrorCodes errCodes, String... messageParams) {
        super(SUCode, RESOURCE_FILE, errCodes.name(), messageParams, null, ExceptionLevel.Error, false);
    }

    public BffEngineCoreException(BffEngineCoreErrorCodes errCodes, String message, Exception innerException) {
        super(SU, errCodes.name(), message, innerException, ExceptionLevel.Error, false);
    }
}
